fix: force-refresh dev release data before triggering agent update#56
Merged
TerrifiedBug merged 3 commits intomainfrom Mar 7, 2026
Merged
fix: force-refresh dev release data before triggering agent update#56TerrifiedBug merged 3 commits intomainfrom
TerrifiedBug merged 3 commits intomainfrom
Conversation
Rolling dev releases replace the binary at the download URL on every push to main. When the UI caches version/checksum data and a new build lands before the user clicks Update, the agent downloads the new binary but the checksum from the stale cache doesn't match — causing a silent update failure loop. Force-refresh dev release info server-side in triggerAgentUpdate so the checksum always matches the binary currently at the download URL.
Contributor
Greptile SummaryThis PR fixes a TOCTOU race condition in the Key improvements:
The fix correctly handles the primary TOCTOU bug and the fallback-to-stale-checksum edge case that would perpetuate the infinite loop. Confidence Score: 4/5
Last reviewed commit: 35d9d30 |
When the version has changed but the checksum can't be retrieved, fail fast instead of silently proceeding with a known-stale checksum that would cause the agent to hit a checksum mismatch on download.
Owner
Author
|
@greptile review |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
pendingAction, ensuring the checksum always matches the binary at the download URLRoot cause
The download URL
releases/download/dev/vf-agent-linux-amd64is a rolling pointer — every push to main rebuilds the dev release with a new binary. When the fleet UI caches version/checksum data and a new build lands before the user clicks Update, the agent downloads the new binary but the cached checksum doesn't match, causing a silent update failure loop:dev-bbcb3a7with checksum325f58ed...dev-281bf67with checksum9f0d8898...325f58ed...281bf67binary → checksum mismatch → failspendingActioncleared → "update available" shows again → loopTest plan
pendingAction